//
//  main.cpp
//  C++  learn
//
//  Created by mc Lee on 2024/10/14.
//

#include <iostream>
using namespace std;

// 计算1到100的所有整数之和：
int sum() {
    int summary = 0;
    for (int i = 1; i <= 100; i++) {
        
        
        summary += i ;
    }
    
    
    return summary;
}

// 输出1到100的所有整数
int foo() {
    int res = 0;
    for(int res = 0; res <= 100; res++) {
        
    }
    return res;
}

void forAndWhile() {
    for (int i = 0; i < 9; i++) {
        if (i == 2) {
            continue;
        }
        cout << i <<endl;
    }
    
    int j = 0;
    while (j < 9) {
        if (j == 2) {
            continue;
        }
        cout << j <<endl;
        j += 2; // j = j + 2;
    }
}

void yearCaculate() {
    // 判断年份是否闰年
    int year = 0;
    printf("请输入年份\n");
    scanf("%d",&year);
    if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {
        printf("闰年\n");
    } else {
        printf("平年\n");
    }
}

void swapNumber() {
    //输入两个数，实现两个数交换
    int a = 0;
    int b = 0;
    int temp = 0;
    printf("请输入数字a和b\n");
    scanf("%d %d", &a, &b);
    temp = a;
    a = b;
    b = temp ;
    printf("a = %d b = %d\n", a, b);
}

void mul() {
    for (int i = 1; i <= 9; i++) {
        for (int j = 1; j <= 9; j++) {
            printf("%d*%d=%d\t", i, j, i*j);
        }
        printf("\n");
    }
}
   
int main(int argc, const char * argv[]) {
    
    yearCaculate();
//    swapNumber();
//    mul();
    
    return 0;
}


